package Threading;

class  MyThread extends Thread{
    @Override
    public void run() {
        while(true){
            System.out.println("==============Thread=================");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

//演示多线程的创建方式
public class Demo1 {

    public static void main(String[] args) {

        MyThread myThread=new MyThread();
        myThread.start();
        while(true){
            System.out.println("main");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }




    }
}
